<template>
  <div>
    <h2 class="box2">销量</h2>
    <div class="chart2" ref="chart2" id="chart2">图2</div>
  </div>
</template>
<script>
import * as echarts from "echarts"
export default {
  mounted() {
    let mod = this.$refs['chart2'];
    let chart2 = echarts.init(mod);
    let option = {
      xAxis: {
        type: 'category',
        data: ['1-3月', '4-6月', '7-10月', '11-1月']
      },
      yAxis: {
        type: 'value',

      },
      series: {
        type: 'line',
        data: [12, 56, 23, 35]
      }
    }
    chart2.setOption(option)
  }
}

</script>
<style lang="less">
.box2 {
  color: pink;
  text-align: center;
}

.chart2 {
  height: 360px;
  background-color: pink;
}
</style>